
import './WijmoA02.scss'

import { Radio } from 'antd'
import { useState } from 'react'
import { getData2 } from '../Data'
import { useMount, useReactive } from 'ahooks'
import { FlexGrid } from '@grapecity/wijmo.react.grid'

const WijmoB07 = () => {
    const InitData = useReactive({ init: null })
    const [Data, setData] = useState()
    const init = (e) => InitData.init = e
    const onChange = (e) => InitData.init.allowPinning = e.target.value

    useMount(() => { setData(getData2(100)) })

    if (Data) {
        return (
            <div className='Page WijmoA02'>
                <FlexGrid allowPinning='SingleColumn' initialized={init} frozenColumns={1} itemsSource={Data} />
                <Radio.Group defaultValue="SingleColumn" buttonStyle="solid" onChange={onChange}>
                    <Radio.Button value="SingleColumn">单选</Radio.Button>
                    <Radio.Button value="ColumnRange">多选</Radio.Button>
                </Radio.Group>
                <div>allowPinning 固定列</div>
                <div>SingleColumn 单独固定某一列 并移动位置</div>
                <div>ColumnRange 固定选中列前的所有列</div>
            </div>
        )
    }
}

export default WijmoB07;